<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件</title>
    <style>
        #move {
            width: 500px;
            height: 500px;
            border: 1px solid red;
        }
    </style>
    <script src="js/jquery-3.5.1.js"></script>
</head>
<body>

mouse: <span id="coordinate"></span>
<div id="move">

</div>

<script>
    $(function () {
        let $move = $('#move');
        $move.mousemove(function (e) {
            $('#coordinate').text(`x: ${e.pageX - $move.offset().left}, y: ${e.pageY - $move.offset().top}`);
        });
    })
</script>

</body>
</html>